package com.jianz.campus_markets.filter;

import java.util.HashMap;
import java.util.Map;

/**
 * {@code @Author}: lzy.
 * {@code @Date}: Created in 2023/5/16
 * {@code @Description}:
 */
public class TrieNode {
    //关键词结束标识
    private boolean isKeywordEnd = false;

    //子节点
    private Map<Character,TrieNode> subNodes = new HashMap<>();

    //isKeywordEnd的get、set方法
    public boolean isKeywordEnd() {
        return isKeywordEnd;
    }

    public void setKeywordEnd(boolean keywordEnd) {
        isKeywordEnd = keywordEnd;
    }

    //添加子节点
    public void addSubNode(Character c,TrieNode node){
        subNodes.put(c,node);
    }

    //获取子节点
    public TrieNode getSubNode(Character c){
        return subNodes.get(c);
    }
}